import VenDashboard from '@/views/VenueAdmin/venDashboard.vue'
import { createRouter, createWebHistory } from 'vue-router'


const routes = [
    {
        path: '/',
        redirect: '/venue/venDashboard' // 调试用
    },
    {
        path: '/login',
        name: 'Login',
        component: () => import('@/views/Common/login.vue'),
        meta: { title: '管理员登录' }
    },
    {
        path: '/venue',
        name: 'Venue',
        component: () => import('@/views/VenueAdmin/venLayout.vue'),
        children: [
            {
                path: 'venDashboard',
                name: 'VenDashboard',
                component: () => import('@/views/VenueAdmin/venDashboard.vue'),
                meta: { title: '赛场信息', showNav: true }
            },
            {
                path: 'changePassword',
                name: 'ChangePassword',
                component: () => import('@/views/Common/changePassword.vue'),
                meta: { title: '修改密码', showNav: true }
            },
            {
                path: 'competition',
                name: 'Competition',
                component: () => import('@/views/VenueAdmin/Competition/competition.vue'),
                meta: { title: '比赛页面', showNav: false }
            },
        ]
    }
]

const router = createRouter({
    history: createWebHistory('/'), // 默认根路径为'/'
    routes
})


export default router // 导出router以供其他文件使用